<?php
header("Content-type: text/html; charset=utf-8");
error_reporting(E_ALL);
class Weapon{
	private $_type;//武器类型
	private $_bullet;//子弹数
	private $_gunsight;//瞄准器类型
	private $_soldiername;//使用者名称
	
	public function __construct($soldiername, $type, $gunsight, $bullet){
		$this->_soldiername = $soldiername;
		$this->_type = $type;
		$this->_gunsight = $gunsight;
		$this->_bullet = $bullet;
	}
	
	public function display(){
		$out = array();
		$out[] = "使用者：{$this->_soldiername}";
		$out[] = "武器类型：{$this->_type}";
		$out[] = "瞄准器类型：{$this->_gunsight}";
		$out[] = "配备子弹数：{$this->_bullet}";
		echo implode('<br/>', $out), '<br/><br/>';
	}
	
	public function setSoldiername($soldiername){
		$this->_soldiername = $soldiername;
	}
	
	public function setType($type){
		$this->_type = $type;
	}
	
	public function setGunsight($gunsight){
		$this->_gunsight = $gunsight;
	}
	
	public function setBullet($bullet){
		$this->_bullet = $bullet;
	}
	
	public function __clone(){
		$this->_soldiername = '请指定士兵的姓名';
	}
}